<div class="modal top" style="width: 560px; height: 280px; top: 35px; right: 130px;"> 
	<div class="modal-body">
		<div id="register-items" class="reg-body">
			<div class="item">  
				<input type="text" name="email" placeholder="邮箱">
				<span class="tip">输入Email地址</span>
			</div>
			<div class="item">  
				<input type="text" name="name" placeholder="昵称">
				<span class="tip">输入昵称</span>
			</div>
			<div class="item">  
				<input type="password" name="password" placeholder="设置密码">
				<span>设置有效密码</span>
			</div>
 		</div>
	</div> 
	<div class="modal-footer"> 
		<a href="#" class="btn primary" onclick="register()">立即注册 »</a>
		<a href="#" class="btn" onclick="toggleRegister()">取 消</a>
	</div>

</div>
<script type="text/javascript">
$(function(){ 
	$(".item input[name=email]").autocomplete({
		source: emailHelper,
		delay: 0,
		autoFocus: true
	}); 
	$("#register-items input[name=password]").keypress(function(e){
		if(e.which == 13){
			register();
	    }
	});  
	$("#register-items input[name=email]").focusout(function(){
		var $email = $(this);
		if(!checkEmail($email)){  
			$email.parent().children("span").html("非法邮箱地址").css("color","red"); 
		}else{ 
			$.post("/check/email",{"email":$(this).val()},function(data){ 
				if(data.status=="0"){ 
					$email.parent().children("span").html("Email已经注册").css("color","red"); 
					$email.focus();
				}else{
					$email.parent().children("span").html("OK").css("color","green");
				}
			}); 
		}
	});
});
</script>